package casts.root
{
   import flash.events.Event;
   
   import jp.progression.casts.CastMovieClip;

   /**
    * @author cjboy1984@gmail.com
    */
   public class LeftTop extends CastMovieClip
   {

      public function LeftTop( initObject:Object = null )
      {
         super( initObject );

         stop();
      }

      // ################### protected ##################

      override protected function atCastAdded():void
      {
         // basic
         onStageResize();
         stage.addEventListener(Event.RESIZE, onStageResize);
      }

      override protected function atCastRemoved():void
      {
         stage.removeEventListener(Event.RESIZE, onStageResize);
      }

      // #################### private ###################

      // --------------------- LINE ---------------------

      private function onStageResize(e:Event = null):void
      {
         x = orgX;
         y = orgY;
      }

      // Original x,y-pos
      private function get orgX():Number { return 0; }
      private function get orgY():Number { return 0; }

      private function get sw():Number { return stage.stageWidth; }
      private function get sh():Number { return stage.stageHeight; }

      // --------------------- LINE ---------------------

   }

}
